package com.test.QtestServer.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.test.QtestServer.mapper.UserMapper;
import com.test.QtestServer.pojo.User;
import com.test.QtestServer.service.UserService;
import com.test.QtestServer.utils.Md5Util;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserMapper userMapper;

    
    @Override
    public User findByUserName(String username){
        User u = userMapper.findByUserName(username);
        return u;
    }

    @Override
    public void register(String username,String password){
        //加密
        String md5Password = Md5Util.getMD5String(password);
        userMapper.add(username,md5Password);
    }

}
